  {% include "header.html" %}
  <script type="text/javascript" >
    var agency_id = "{{ agency_id }}";
    var route_type = "{{ route_type }}";
  </script>
  <h1>Route  List <a href="http://code.google.com/transit/spec/transit_feed_specification.html#routes_txt___Field_Definitions">Refer</a></h1>
  {% if prompt %}
  <p id="prompt">{{ prompt }}</p>
  {% endif %}
  <div id="editor">
    <form method="POST" action="{{ url }}" id="editorform">
      <table>
        <tr>
          <th>Items</th>
          <th>Values</th>
        </tr>
        <tr>
          <td>ID</td>
          <td><input name = "route_id" id = "route_id" type="TEXT" value="{{ route.id }}"/></td>
        </tr>
        <tr>
          <td>Agency ID</td>
          <td>
          <select name = "agency_id" id = "agency_id">
          {% for agency in agencies %}
             {% if agency.id == agency_id %}
             <option value="{{agency.id}}" selected>{{agency.name}}</option>
             {% else %}
             <option value="{{agency.id}}">{{agency.name}}</option>
             {% endif %}
          {% endfor %}
          </select></td>
        </tr>
        <tr>
          <td>Short Name</td>
          <td><input name = "route_short_name" id = "route_short_name" type="TEXT" value="{{ route.shortName }}"/></td>
        </tr>
        <tr>
          <td>Long Name</td>
          <td><input name = "route_long_name" id = "route_long_name" type="TEXT" value="{{ route.longName }}"/></td>
        </tr>
        <tr>
          <td>Type</td>
          <td><label>
            <select name="route_type" id="route_type">
            </select>
          </label></td>
        </tr>
        <tr>
          <td>Color</td>
          <td><input name = "route_color" id = "route_color" value="{{route.color}}""></td>
        </tr>
        <tr>
          <td>Text Color</td>
          <td><input name = "route_text_color" id = "route_text_color" value="{{route.textColor}}" ></td>
        </tr>
        <tr>
          <td>Description</td>
          <td><textarea name = "route_desc" id = "route_desc" rows="5">{{ route.desc }}</textarea></td>
        </tr>
        <tr>
          <td>Url</td>
          <td><input name = 'route_url' id = "route_url" type="TEXT" value="{{ route.url }}"/></td>
        </tr>
        <tr>
          <td colspan="2">
            <input type="submit" id = "submit" value="{{ submit }}" name = "submit" />
          </td>
        </tr>
        </table>
  </form>


    </div>
<div class="sort">
  <form method="POST" action="" name="search">
    <input type="text" value=""/> <input type="submit" value="Search"/>
  </form>


    </div>
    <div class="pager">
      paging info: [<a href="#">1</a>] [<a href="#">2</a>] ... [<a href="#">last</a>] <input type="text" value="" size="4" maxlength="4"/> <input type="submit" value="Go" />
    </div>
    <table>
      <tr>
        <th>&nbsp;</th>
        <th>ID</th>
        <th>Agency ID</th>
        <th>Short Name</th>
        <th>Long Name</th>
        <th>Type</th>
        <th>Color</th>
        <th>Text Color</th>
        <th>Description</th>
        <th>Url</th>
        <th> Subsidiary</th>
        <th>Action</th>
      </tr>
      <!--
      <tr>
        <td><input type="checkbox" /></td>
        <td>SLOT</td>
        <td>Boston Data Center </td>
        <td>Australia/Darwin</td>
        <td>en</td>
        <td>(132) 2923-282-ABC</td>
        <td>http://www.google.com</td>
        <td><a href="#">Routes</a></td>
        <td><a href="#">Edit</a>&nbsp;<a href="#">Delete</a><a href="#"></a></td>
      </tr>
      -->
      {% for route in routes %}
      <tr>
        <td><input type="checkbox" name="deleteid" value="{{route.id}}"/></td>
        <td>{{route.id}}</td>
        <td>{{route.agencyId}}</td>
        <td>{{route.shortName}}</td>
        <td>{{route.longName}}</td>
        <td>{{route.type}}</td>
        <td>{{route.color}}</td>
        <td>{{route.textColor}}</td>
        <td>{{route.desc}}</td>
        <td>{{route.url}}</td>
        <td><a href="#">Patterns</a> <a href="#">Trips</a><a href="/admin/route?agency={{agency_id}}"></a></td>
        <td>
          <a href="/admin/route?act=edit&id={{route.id}}">Edit</a>&nbsp;
          <a href="/admin/route?act=delete&id={{route.id}}">Delete</a>
        </td>
      </tr>
      {% endfor %}
    </table>
    <div class="pager">
      [<a href="#">1</a>] [<a href="#">2</a>] ... [<a href="#">last</a>] <input type="text" value="" size="4" maxlength="4"/> <input type="submit" value="Go" />
    </div>
    <div class="control">
      <input type="submit" value="Delete All"/>
    </div>
  </body>
</html>
